﻿using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DAL
{
    public class Shuju
    {
        public int UserBool(string name,string pwd)
        {
            SqlConnection conn = new SqlConnection(@"Data Source=WIN-01701092026;Initial Catalog=huiyuanguanli2;
                                                    Integrated Security=True");
            string sql = string.Format("select count(*) from Admin where adminname ='{0}'and adminpwd = '{1}'",name,pwd);
            
            SqlCommand cmd = new SqlCommand(sql, conn);
            conn.Open();
            object count = cmd.ExecuteScalar();
            conn.Close();
            return (Int32)count;
           
        }
    }
}
